# @Time:2023/4/26 19:40
# -*- coding: UTF-8 -*-

from rest_framework import serializers
from cart.models import Cart
from goods.serializers import GoodsSerializer


class CartSerializer(serializers.ModelSerializer):
    """写入 购物车序列化器"""
    class Meta:
        model=Cart
        fields="__all__"

class ReadCartSerializer(serializers.ModelSerializer):
    """读取购物车，信息序列化器"""
    goods=GoodsSerializer()

    class Meta:
        model = Cart
        fields = "__all__"
